package com.push_label.server;

import com.push_label.bean.product.ProductInfo;
import com.push_label.mapper.ProductMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

import java.util.List;

@Service
@Slf4j
public class ProductServiceImpl implements ProductService {


    @Resource
    private ProductMapper productMapper;


    @Cacheable(cacheNames = "product",key = "'all'" ,unless = "#result == null")
    @Override
    public List<ProductInfo> getAllProduct() {
        return productMapper.getAllProduct();
    }
}
